<template>
  <div class="panthumb" :style="{width, height, ZIndex}">
    <div class="bottom">
      <slot />
    </div>
    <div class="top" :style="{backgroundImage: `url(${image})`}"></div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'
defineProps({
  width: {
    type: String
  },
  height: {
    type: String
  },
  ZIndex: {
    type: Number,
    default: 0
  },
  image: {
    type: String
  }
})
</script>

<style lang="scss" scoped>
.panthumb {
  width: 100px;
  height: 100px;
  position: relative;
  cursor: pointer;
  .bottom {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 6px solid #eee;
    border-radius: 50%;
    text-align: center;
    font-size: 14px;
    position: absolute;
    padding: 20px;
    left: 0;
    top: 0;
  }
  .top {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0;
    background-size: 100%;
    transform-origin: 95% 35%;
    transition: all .4s ease-in-out;
  }
  &:hover {
    .top {
      transform: rotate(-110deg);
    }
  }
}
</style>
